import React, {Component} from 'react'
import {observer} from 'mobx-react';
import { withRouter } from 'react-router-dom';
import BasicList from './BasicList';
import Map from './Map';

@withRouter
@observer
export default class RecordView extends Component {
  getComponent = () => {
    const {store: {viewType}, resourceId} = this.props;
    if(viewType == 0)
      return (<BasicList store={this.props.store} resourceId={resourceId}/>);
    return (<Map store={this.props.store} resourceId={resourceId}/>);
  }

  render() {
    return this.getComponent();
  }
}